Class: Io::Flow::V0::Client

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

Defined Under Namespace

Modules: Constants

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, opts = {}) ⇒ Client

Returns a new instance of Client.



36
37
38
39
40
41
42
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36

def initialize(url, opts={})
  @url = HttpClient::Preconditions.assert_class('url', url, String)
  @authorization = HttpClient::Preconditions.assert_class_or_nil('authorization', opts.delete(:authorization), HttpClient::Authorization)
  @default_headers = HttpClient::Preconditions.assert_class('default_headers', opts.delete(:default_headers) || {}, Hash)
  HttpClient::Preconditions.assert_empty_opts(opts)
  HttpClient::Preconditions.check_state(url.match(/http.+/i), "URL[%s] must start with http" % url)
end

Instance Attribute Details

#url ⇒ Object (readonly)

Returns the value of attribute url.



34
35
36
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34

def url
  @url
end

Instance Method Details

#addresses ⇒ Object



256
257
258
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 256

def addresses
  @addresses ||= ::Io::Flow::V0::Clients::Addresses.new(self)
end

#allocations ⇒ Object



64
65
66
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64

def allocations
  @allocations ||= ::Io::Flow::V0::Clients::Allocations.new(self)
end

#attributes ⇒ Object



68
69
70
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68

def attributes
  @attributes ||= ::Io::Flow::V0::Clients::Attributes.new(self)
end

#authorizations ⇒ Object



168
169
170
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 168

def authorizations
  @authorizations ||= ::Io::Flow::V0::Clients::Authorizations.new(self)
end

#captures ⇒ Object



172
173
174
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 172

def captures
  @captures ||= ::Io::Flow::V0::Clients::Captures.new(self)
end

#cards ⇒ Object



176
177
178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 176

def cards
  @cards ||= ::Io::Flow::V0::Clients::Cards.new(self)
end

#catalogs ⇒ Object



72
73
74
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 72

def catalogs
  @catalogs ||= ::Io::Flow::V0::Clients::Catalogs.new(self)
end

#centers ⇒ Object



188
189
190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 188

def centers
  @centers ||= ::Io::Flow::V0::Clients::Centers.new(self)
end

#countries ⇒ Object



268
269
270
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 268

def countries
  @countries ||= ::Io::Flow::V0::Clients::Countries.new(self)
end

#country_defaults ⇒ Object



260
261
262
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 260

def country_defaults
  @country_defaults ||= ::Io::Flow::V0::Clients::CountryDefaults.new(self)
end

#currencies ⇒ Object



272
273
274
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 272

def currencies
  @currencies ||= ::Io::Flow::V0::Clients::Currencies.new(self)
end

#delivery_windows ⇒ Object



192
193
194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 192

def delivery_windows
  @delivery_windows ||= ::Io::Flow::V0::Clients::DeliveryWindows.new(self)
end

#documents ⇒ Object



288
289
290
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 288

def documents
  @documents ||= ::Io::Flow::V0::Clients::Documents.new(self)
end

#email_verifications ⇒ Object



292
293
294
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 292

def email_verifications
  @email_verifications ||= ::Io::Flow::V0::Clients::EmailVerifications.new(self)
end

#experience_defaults ⇒ Object



80
81
82
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 80

def experience_defaults
  @experience_defaults ||= ::Io::Flow::V0::Clients::ExperienceDefaults.new(self)
end

#experiences ⇒ Object



76
77
78
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 76

def experiences
  @experiences ||= ::Io::Flow::V0::Clients::Experiences.new(self)
end

#exports ⇒ Object



296
297
298
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 296

def exports
  @exports ||= ::Io::Flow::V0::Clients::Exports.new(self)
end

#harmonization_settings ⇒ Object



136
137
138
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 136

def harmonization_settings
  @harmonization_settings ||= ::Io::Flow::V0::Clients::HarmonizationSettings.new(self)
end

#harmonized_categories ⇒ Object



140
141
142
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 140

def harmonized_categories
  @harmonized_categories ||= ::Io::Flow::V0::Clients::HarmonizedCategories.new(self)
end

#harmonized_item_duties ⇒ Object



148
149
150
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 148

def harmonized_item_duties
  @harmonized_item_duties ||= ::Io::Flow::V0::Clients::HarmonizedItemDuties.new(self)
end

#harmonized_items ⇒ Object



144
145
146
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 144

def harmonized_items
  @harmonized_items ||= ::Io::Flow::V0::Clients::HarmonizedItems.new(self)
end

#harmonized_landed_costs ⇒ Object



152
153
154
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 152

def harmonized_landed_costs
  @harmonized_landed_costs ||= ::Io::Flow::V0::Clients::HarmonizedLandedCosts.new(self)
end

#healthchecks ⇒ Object



300
301
302
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 300

def healthchecks
  @healthchecks ||= ::Io::Flow::V0::Clients::Healthchecks.new(self)
end

#hs10 ⇒ Object



156
157
158
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 156

def hs10
  @hs10 ||= ::Io::Flow::V0::Clients::Hs10.new(self)
end

#hs6 ⇒ Object



160
161
162
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 160

def hs6
  @hs6 ||= ::Io::Flow::V0::Clients::Hs6.new(self)
end

#hs_codes ⇒ Object



164
165
166
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 164

def hs_codes
  @hs_codes ||= ::Io::Flow::V0::Clients::HsCodes.new(self)
end

#imports ⇒ Object



304
305
306
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 304

def imports
  @imports ||= ::Io::Flow::V0::Clients::Imports.new(self)
end

#inventory_rules ⇒ Object



196
197
198
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 196

def inventory_rules
  @inventory_rules ||= ::Io::Flow::V0::Clients::InventoryRules.new(self)
end

#inventory_snapshots ⇒ Object



200
201
202
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 200

def inventory_snapshots
  @inventory_snapshots ||= ::Io::Flow::V0::Clients::InventorySnapshots.new(self)
end

#inventory_updates ⇒ Object



204
205
206
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 204

def inventory_updates
  @inventory_updates ||= ::Io::Flow::V0::Clients::InventoryUpdates.new(self)
end

#invitations ⇒ Object



308
309
310
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 308

def invitations
  @invitations ||= ::Io::Flow::V0::Clients::Invitations.new(self)
end

#item_functions ⇒ Object



124
125
126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 124

def item_functions
  @item_functions ||= ::Io::Flow::V0::Clients::ItemFunctions.new(self)
end

#items ⇒ Object



84
85
86
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 84

def items
  @items ||= ::Io::Flow::V0::Clients::Items.new(self)
end

#languages ⇒ Object



276
277
278
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 276

def languages
  @languages ||= ::Io::Flow::V0::Clients::Languages.new(self)
end

#locales ⇒ Object



280
281
282
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 280

def locales
  @locales ||= ::Io::Flow::V0::Clients::Locales.new(self)
end

#memberships ⇒ Object



312
313
314
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 312

def memberships
  @memberships ||= ::Io::Flow::V0::Clients::Memberships.new(self)
end

#order_estimates ⇒ Object



92
93
94
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 92

def order_estimates
  @order_estimates ||= ::Io::Flow::V0::Clients::OrderEstimates.new(self)
end

#order_identifiers ⇒ Object



96
97
98
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 96

def order_identifiers
  @order_identifiers ||= ::Io::Flow::V0::Clients::OrderIdentifiers.new(self)
end

#orders ⇒ Object



88
89
90
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 88

def orders
  @orders ||= ::Io::Flow::V0::Clients::Orders.new(self)
end

#organization_authorizations ⇒ Object



316
317
318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 316

def organization_authorizations
  @organization_authorizations ||= ::Io::Flow::V0::Clients::OrganizationAuthorizations.new(self)
end

#organization_currency_settings ⇒ Object



128
129
130
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 128

def organization_currency_settings
  @organization_currency_settings ||= ::Io::Flow::V0::Clients::OrganizationCurrencySettings.new(self)
end

#organization_tokens ⇒ Object



320
321
322
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 320

def organization_tokens
  @organization_tokens ||= ::Io::Flow::V0::Clients::OrganizationTokens.new(self)
end

#organizations ⇒ Object



100
101
102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 100

def organizations
  @organizations ||= ::Io::Flow::V0::Clients::Organizations.new(self)
end

#partner_tokens ⇒ Object



324
325
326
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 324

def partner_tokens
  @partner_tokens ||= ::Io::Flow::V0::Clients::PartnerTokens.new(self)
end

#password_reset_forms ⇒ Object



328
329
330
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 328

def password_reset_forms
  @password_reset_forms ||= ::Io::Flow::V0::Clients::PasswordResetForms.new(self)
end

#public_keys ⇒ Object



180
181
182
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 180

def public_keys
  @public_keys ||= ::Io::Flow::V0::Clients::PublicKeys.new(self)
end

#queries ⇒ Object



104
105
106
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 104

def queries
  @queries ||= ::Io::Flow::V0::Clients::Queries.new(self)
end

#quotes ⇒ Object



208
209
210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 208

def quotes
  @quotes ||= ::Io::Flow::V0::Clients::Quotes.new(self)
end

#rates ⇒ Object



132
133
134
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 132

def rates
  @rates ||= ::Io::Flow::V0::Clients::Rates.new(self)
end

#refunds ⇒ Object



184
185
186
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 184

def refunds
  @refunds ||= ::Io::Flow::V0::Clients::Refunds.new(self)
end

#regions ⇒ Object



284
285
286
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 284

def regions
  @regions ||= ::Io::Flow::V0::Clients::Regions.new(self)
end

#request(path = nil) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49

def request(path=nil)
  HttpClient::Preconditions.assert_class_or_nil('path', path, String)
  request = HttpClient::Request.new(URI.parse(@url + path.to_s)).with_header('User-Agent', Constants::USER_AGENT).with_header('X-Apidoc-Version', Constants::VERSION).with_header('X-Apidoc-Version-Major', Constants::VERSION_MAJOR)

  @default_headers.each do |key, value|
    request = request.with_header(key, value)
  end

  if @authorization
    request = request.with_auth(@authorization)
  end

  request
end

#returns ⇒ Object



212
213
214
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 212

def returns
  @returns ||= ::Io::Flow::V0::Clients::Returns.new(self)
end

#scheduled_exports ⇒ Object



332
333
334
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 332

def scheduled_exports
  @scheduled_exports ||= ::Io::Flow::V0::Clients::ScheduledExports.new(self)
end

#session_authorizations ⇒ Object



340
341
342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 340

def session_authorizations
  @session_authorizations ||= ::Io::Flow::V0::Clients::SessionAuthorizations.new(self)
end

#sessions ⇒ Object



336
337
338
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 336

def sessions
  @sessions ||= ::Io::Flow::V0::Clients::Sessions.new(self)
end

#shipping_labels ⇒ Object



216
217
218
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 216

def shipping_labels
  @shipping_labels ||= ::Io::Flow::V0::Clients::ShippingLabels.new(self)
end

#shipping_notifications ⇒ Object



220
221
222
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 220

def shipping_notifications
  @shipping_notifications ||= ::Io::Flow::V0::Clients::ShippingNotifications.new(self)
end

#subcatalog_items ⇒ Object



112
113
114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 112

def subcatalog_items
  @subcatalog_items ||= ::Io::Flow::V0::Clients::SubcatalogItems.new(self)
end

#subcatalogs ⇒ Object



108
109
110
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 108

def subcatalogs
  @subcatalogs ||= ::Io::Flow::V0::Clients::Subcatalogs.new(self)
end

#suggestions ⇒ Object



344
345
346
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 344

def suggestions
  @suggestions ||= ::Io::Flow::V0::Clients::Suggestions.new(self)
end

#targeting_items ⇒ Object



120
121
122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 120

def targeting_items
  @targeting_items ||= ::Io::Flow::V0::Clients::TargetingItems.new(self)
end

#targetings ⇒ Object



116
117
118
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 116

def targetings
  @targetings ||= ::Io::Flow::V0::Clients::Targetings.new(self)
end

#tier_defaults ⇒ Object



228
229
230
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 228

def tier_defaults
  @tier_defaults ||= ::Io::Flow::V0::Clients::TierDefaults.new(self)
end

#tier_rules ⇒ Object



232
233
234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 232

def tier_rules
  @tier_rules ||= ::Io::Flow::V0::Clients::TierRules.new(self)
end

#tiers ⇒ Object



224
225
226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 224

def tiers
  @tiers ||= ::Io::Flow::V0::Clients::Tiers.new(self)
end

#timezones ⇒ Object



264
265
266
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 264

def timezones
  @timezones ||= ::Io::Flow::V0::Clients::Timezones.new(self)
end

#token_validations ⇒ Object



352
353
354
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 352

def token_validations
  @token_validations ||= ::Io::Flow::V0::Clients::TokenValidations.new(self)
end

#tokens ⇒ Object



348
349
350
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 348

def tokens
  @tokens ||= ::Io::Flow::V0::Clients::Tokens.new(self)
end

#tracking_events ⇒ Object



240
241
242
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 240

def tracking_events
  @tracking_events ||= ::Io::Flow::V0::Clients::TrackingEvents.new(self)
end

#tracking_labels ⇒ Object



244
245
246
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 244

def tracking_labels
  @tracking_labels ||= ::Io::Flow::V0::Clients::TrackingLabels.new(self)
end

#trackings ⇒ Object



236
237
238
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 236

def trackings
  @trackings ||= ::Io::Flow::V0::Clients::Trackings.new(self)
end

#uploads ⇒ Object



356
357
358
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 356

def uploads
  @uploads ||= ::Io::Flow::V0::Clients::Uploads.new(self)
end

#users ⇒ Object



360
361
362
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 360

def users
  @users ||= ::Io::Flow::V0::Clients::Users.new(self)
end

#webhook_deliveries ⇒ Object



252
253
254
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 252

def webhook_deliveries
  @webhook_deliveries ||= ::Io::Flow::V0::Clients::WebhookDeliveries.new(self)
end

#webhooks ⇒ Object



248
249
250
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 248

def webhooks
  @webhooks ||= ::Io::Flow::V0::Clients::Webhooks.new(self)
end