TDClient

Objective-C

@interface TDClient

Swift

class TDClient

The internal client using for sending requests. Most of the exposed properties could be configured via the container TreasureData instance. You probably need this only to tuning the retry parameters.

  • The API Key (write-only) uses for this client

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *apiKey;

    Swift

    var apiKey: String! { get set }
  • The targeting API endpoint, default is https://us01.records.in.treasuredata.com

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *apiEndpoint;

    Swift

    var apiEndpoint: String! { get set }

Retry

  • Enable retry if uploading events failed.

    Declaration

    Objective-C

    @property BOOL enableRetryUploading;

    Swift

    var enableRetryUploading: Bool { get set }
  • Waiting time for next retry = retryIntervalCoefficient x retryIntervalBasebase ^ retryTime

    Declaration

    Objective-C

    @property int uploadRetryIntervalCoeficient;

    Swift

    var uploadRetryIntervalCoeficient: Int32 { get set }
  • Wait time for next retry = retryIntervalCoefficient x retryIntervalBasebase ^ retryTime

    Declaration

    Objective-C

    @property int uploadRetryIntervalBase;

    Swift

    var uploadRetryIntervalBase: Int32 { get set }
  • The max number of retry

    Declaration

    Objective-C

    @property int uploadRetryCount;

    Swift

    var uploadRetryCount: Int32 { get set }

Deprecated

  • Deprecated

    Construct from TreasureData instead.

    Undocumented

    Declaration

    Objective-C

    - (id)initWithApiKey:(NSString *)apiKey apiEndpoint:(NSString*)apiEndpoint DEPRECATED_MSG_ATTRIBUTE("Construct from TreasureData instead.");

    Swift

    init!(apiKey: String!, apiEndpoint: String!)
  • Deprecated

    This will become private property on next version.

    The pending session of this client.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSURLSession *session;

    Swift

    var session: URLSession! { get set }
  • Deprecated

    Configure this on TreasureData instead.

    Enable compression event data payload on uploading requests.

    Declaration

    Objective-C

    @property BOOL enableEventCompression;

    Swift

    var enableEventCompression: Bool { get set }
  • Deprecated

    Don’t call this directly, this will become private on next version.

    Undocumented

    Declaration

    Objective-C

    - (void) sendHTTPRequest:(NSURLRequest *)request
                retryCounter:(int)retryCounter
           completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler DEPRECATED_MSG_ATTRIBUTE("Don't call this directly, this will become private on next version.");

    Swift

    func sendHTTPRequest(_ request: URLRequest!, retryCounter: Int32) async throws -> (Data?, URLResponse?)