C# Class Keen.Core.KeenUtil

Afficher le fichier Open project: keenlabs/keen-sdk-net Class Usage Examples

Méthodes publiques

Méthode Description
CheckApiErrorCode ( dynamic apiResponse ) : void

Check the 'error_code' field and throw the appropriate exception if non-null.

GetBulkApiError ( Newtonsoft.Json.Linq.JObject apiResponse ) : Exception

Check the 'error' field on a bulk insert operation response and return the appropriate exception.

ToSafeString ( this obj ) : string
TryGetDouble ( this s ) : double?
TryGetInt ( this s ) : int?
ValidateEventCollectionName ( string collection ) : void

Apply the collection name restrictions. Throws KeenException with an explanation if a collection name is unacceptable.

ValidatePropertyName ( string property ) : void

Apply property name restrictions. Throws KeenException with an explanation if a collection name is unacceptable.

Private Methods

Méthode Description
TryUnwrap ( this ex ) : Exception

Flatten an AggregateException and if only one exception instance is found in the innerexceptions, return it, otherwise return the original AggregateException unchanged.

Method Details

CheckApiErrorCode() public static méthode

Check the 'error_code' field and throw the appropriate exception if non-null.
public static CheckApiErrorCode ( dynamic apiResponse ) : void
apiResponse dynamic Deserialized json response from a Keen API call.
Résultat void

GetBulkApiError() public static méthode

Check the 'error' field on a bulk insert operation response and return the appropriate exception.
public static GetBulkApiError ( Newtonsoft.Json.Linq.JObject apiResponse ) : Exception
apiResponse Newtonsoft.Json.Linq.JObject Deserialized json response from a Keen API call.
Résultat System.Exception

ToSafeString() public static méthode

public static ToSafeString ( this obj ) : string
obj this
Résultat string

TryGetDouble() public static méthode

public static TryGetDouble ( this s ) : double?
s this
Résultat double?

TryGetInt() public static méthode

public static TryGetInt ( this s ) : int?
s this
Résultat int?

ValidateEventCollectionName() public static méthode

Apply the collection name restrictions. Throws KeenException with an explanation if a collection name is unacceptable.
public static ValidateEventCollectionName ( string collection ) : void
collection string
Résultat void

ValidatePropertyName() public static méthode

Apply property name restrictions. Throws KeenException with an explanation if a collection name is unacceptable.
public static ValidatePropertyName ( string property ) : void
property string
Résultat void