Class: Inttegro::Client

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/inttegro/client.rb

Overview

Main entry point for interacting with the Inttegro API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token_value = nil, api_key: nil, token: nil, base_url: DEFAULT_BASE_URL, read_timeout: 30, open_timeout: 10, adapter: nil, telemetry_enabled: true, tracer_provider: nil, error_reporter: nil, error_reporting_policy: :unexpected) ⇒ Client

Returns a new instance of Client.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/inttegro/client.rb', line 119

def initialize(
  token_value = nil,
  api_key: nil,
  token: nil,
  base_url: DEFAULT_BASE_URL,
  read_timeout: 30,
  open_timeout: 10,
  adapter: nil,
  telemetry_enabled: true,
  tracer_provider: nil,
  error_reporter: nil,
  error_reporting_policy: :unexpected
)
  provided_token = token || token_value
  api_key ||= provided_token
  @http = T.let(HTTPClient.new(
    api_key: api_key,
    base_url: base_url,
    read_timeout: read_timeout,
    open_timeout: open_timeout,
    adapter: adapter,
    telemetry_enabled: telemetry_enabled,
    tracer_provider: tracer_provider,
    error_reporter: error_reporter,
    error_reporting_policy: error_reporting_policy
  ), HTTPClient)

  @orders = T.let(Resources::Orders.new(@http), Resources::Orders)
  @otp = T.let(Resources::Otp.new(@http), Resources::Otp)
  @chimes = T.let(Resources::Chimes.new(@http), Resources::Chimes)
  @schedules = T.let(Resources::Schedules.new(@http), Resources::Schedules)
  @broadcasts = T.let(Resources::Broadcasts.new(@http), Resources::Broadcasts)
  @message_templates = T.let(Resources::MessageTemplates.new(@http), Resources::MessageTemplates)
  @payment_methods = T.let(Resources::PaymentMethods.new(@http), Resources::PaymentMethods)
  @payouts = T.let(Resources::Payouts.new(@http), Resources::Payouts)
  @refunds = T.let(Resources::Refunds.new(@http), Resources::Refunds)
  @balance_transactions = T.let(Resources::BalanceTransactions.new(@http), Resources::BalanceTransactions)
  @financial_accounts = T.let(Resources::FinancialAccounts.new(@http), Resources::FinancialAccounts)
  @file_references = T.let(Resources::FileReferences.new(@http), Resources::FileReferences)
  @files = T.let(Resources::Files.new(@http), Resources::Files)
  @file_links = T.let(Resources::FileLinks.new(@http), Resources::FileLinks)
  @customers = T.let(Resources::Customers.new(@http), Resources::Customers)
  @products = T.let(Resources::Products.new(@http), Resources::Products)
  @prices = T.let(Resources::Prices.new(@http), Resources::Prices)
  @purchase_intents = T.let(Resources::PurchaseIntents.new(@http), Resources::PurchaseIntents)
  @balances = T.let(Resources::Balances.new(@http), Resources::Balances)
  @apps = T.let(Resources::Apps.new(@http), Resources::Apps)
  @keys = T.let(Resources::Keys.new(@http), Resources::Keys)
  @spec = T.let(Resources::Spec.new(@http), Resources::Spec)
  @upload_requests = T.let(Resources::UploadRequests.new(@http), Resources::UploadRequests)
end

Instance Attribute Details

#appsObject (readonly)

Returns the value of attribute apps.



93
94
95
# File 'lib/inttegro/client.rb', line 93

def apps
  @apps
end

#balance_transactionsObject (readonly)

Returns the value of attribute balance_transactions.



63
64
65
# File 'lib/inttegro/client.rb', line 63

def balance_transactions
  @balance_transactions
end

#balancesObject (readonly)

Returns the value of attribute balances.



90
91
92
# File 'lib/inttegro/client.rb', line 90

def balances
  @balances
end

#broadcastsObject (readonly)

Returns the value of attribute broadcasts.



48
49
50
# File 'lib/inttegro/client.rb', line 48

def broadcasts
  @broadcasts
end

#chimesObject (readonly)

Returns the value of attribute chimes.



42
43
44
# File 'lib/inttegro/client.rb', line 42

def chimes
  @chimes
end

#customersObject (readonly)

Returns the value of attribute customers.



78
79
80
# File 'lib/inttegro/client.rb', line 78

def customers
  @customers
end

Returns the value of attribute file_links.



75
76
77
# File 'lib/inttegro/client.rb', line 75

def file_links
  @file_links
end

#file_referencesObject (readonly)

Returns the value of attribute file_references.



69
70
71
# File 'lib/inttegro/client.rb', line 69

def file_references
  @file_references
end

#filesObject (readonly)

Returns the value of attribute files.



72
73
74
# File 'lib/inttegro/client.rb', line 72

def files
  @files
end

#financial_accountsObject (readonly)

Returns the value of attribute financial_accounts.



66
67
68
# File 'lib/inttegro/client.rb', line 66

def financial_accounts
  @financial_accounts
end

#keysObject (readonly)

Returns the value of attribute keys.



96
97
98
# File 'lib/inttegro/client.rb', line 96

def keys
  @keys
end

#message_templatesObject (readonly)

Returns the value of attribute message_templates.



51
52
53
# File 'lib/inttegro/client.rb', line 51

def message_templates
  @message_templates
end

#ordersObject (readonly)

Returns the value of attribute orders.



36
37
38
# File 'lib/inttegro/client.rb', line 36

def orders
  @orders
end

#otpObject (readonly)

Returns the value of attribute otp.



39
40
41
# File 'lib/inttegro/client.rb', line 39

def otp
  @otp
end

#payment_methodsObject (readonly)

Returns the value of attribute payment_methods.



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

def payment_methods
  @payment_methods
end

#payoutsObject (readonly)

Returns the value of attribute payouts.



57
58
59
# File 'lib/inttegro/client.rb', line 57

def payouts
  @payouts
end

#pricesObject (readonly)

Returns the value of attribute prices.



84
85
86
# File 'lib/inttegro/client.rb', line 84

def prices
  @prices
end

#productsObject (readonly)

Returns the value of attribute products.



81
82
83
# File 'lib/inttegro/client.rb', line 81

def products
  @products
end

#purchase_intentsObject (readonly)

Returns the value of attribute purchase_intents.



87
88
89
# File 'lib/inttegro/client.rb', line 87

def purchase_intents
  @purchase_intents
end

#refundsObject (readonly)

Returns the value of attribute refunds.



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

def refunds
  @refunds
end

#schedulesObject (readonly)

Returns the value of attribute schedules.



45
46
47
# File 'lib/inttegro/client.rb', line 45

def schedules
  @schedules
end

#specObject (readonly)

Returns the value of attribute spec.



99
100
101
# File 'lib/inttegro/client.rb', line 99

def spec
  @spec
end

#upload_requestsObject (readonly)

Returns the value of attribute upload_requests.



102
103
104
# File 'lib/inttegro/client.rb', line 102

def upload_requests
  @upload_requests
end