Class: Ittybit::AsyncClient

Inherits:
Object
  • Object
show all
Defined in:
lib/ittybit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url: nil, environment: Ittybit::Environment::DEFAULT, max_retries: nil, timeout_in_seconds: nil, api_key: ENV["ITTYBIT_API_KEY"], version: nil) ⇒ Ittybit::AsyncClient

Parameters:

  • base_url (String) (defaults to: nil)
  • environment (Ittybit::Environment) (defaults to: Ittybit::Environment::DEFAULT)
  • max_retries (Long) (defaults to: nil)

    The number of times to retry a failed request, defaults to 2.

  • timeout_in_seconds (Long) (defaults to: nil)
  • api_key (String) (defaults to: ENV["ITTYBIT_API_KEY"])
  • version (String) (defaults to: nil)


69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/ittybit.rb', line 69

def initialize(base_url: nil, environment: Ittybit::Environment::DEFAULT, max_retries: nil,
               timeout_in_seconds: nil, api_key: ENV["ITTYBIT_API_KEY"], version: nil)
  @async_request_client = Ittybit::AsyncRequestClient.new(
    base_url: base_url,
    environment: environment,
    max_retries: max_retries,
    timeout_in_seconds: timeout_in_seconds,
    api_key: api_key,
    version: version
  )
  @automations = Ittybit::AsyncAutomationsClient.new(request_client: @async_request_client)
  @files = Ittybit::AsyncFilesClient.new(request_client: @async_request_client)
  @media = Ittybit::AsyncMediaClient.new(request_client: @async_request_client)
  @tasks = Ittybit::AsyncTasksClient.new(request_client: @async_request_client)
  @signatures = Ittybit::AsyncSignaturesClient.new(request_client: @async_request_client)
end

Instance Attribute Details

#automationsIttybit::AsyncAutomationsClient (readonly)



52
53
54
# File 'lib/ittybit.rb', line 52

def automations
  @automations
end

#filesIttybit::AsyncFilesClient (readonly)



54
55
56
# File 'lib/ittybit.rb', line 54

def files
  @files
end

#mediaIttybit::AsyncMediaClient (readonly)



56
57
58
# File 'lib/ittybit.rb', line 56

def media
  @media
end

#signaturesIttybit::AsyncSignaturesClient (readonly)



60
61
62
# File 'lib/ittybit.rb', line 60

def signatures
  @signatures
end

#tasksIttybit::AsyncTasksClient (readonly)



58
59
60
# File 'lib/ittybit.rb', line 58

def tasks
  @tasks
end