Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Client

Inherits:
Object
  • Object
show all
Includes:
CoreLibrary
Defined in:
lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb

Overview

inventory_management_and_item_management_and_order_management_and_price_management client class.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection: nil, adapter: :net_http_persistent, timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 2, retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods: %i[get put],, http_callback: nil, proxy_settings: nil, environment: Environment::PRODUCTION, config: nil) ⇒ Client

Returns a new instance of Client.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 179

def initialize(
  connection: nil, adapter: :net_http_persistent, timeout: 60,
  max_retries: 0, retry_interval: 1, backoff_factor: 2,
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
  retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
  environment: Environment::PRODUCTION, config: nil
)
  @config = if config.nil?
              Configuration.new(connection: connection, adapter: adapter,
                                timeout: timeout, max_retries: max_retries,
                                retry_interval: retry_interval,
                                backoff_factor: backoff_factor,
                                retry_statuses: retry_statuses,
                                retry_methods: retry_methods,
                                http_callback: http_callback,
                                proxy_settings: proxy_settings,
                                environment: environment)
            else
              config
            end

  @global_configuration = GlobalConfiguration.new(client_configuration: @config)
                                             .base_uri_executor(@config.method(:get_base_uri))
                                             .global_errors(BaseController::GLOBAL_ERRORS)
                                             .user_agent(BaseController.user_agent)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



11
12
13
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 11

def config
  @config
end

Class Method Details

.from_env(**overrides) ⇒ Object

Creates a client directly from environment variables.



207
208
209
210
211
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 207

def self.from_env(**overrides)
  default_config = Configuration.build_default_config_from_env
  new_config = default_config.clone_with(**overrides)
  new(config: new_config)
end

Instance Method Details

#acknowledgeAcknowledgeController

Access to acknowledge controller.

Returns:



103
104
105
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 103

def acknowledge
  @acknowledge ||= AcknowledgeController.new @global_configuration
end

#associationsAssociationsController

Access to associations controller.

Returns:



55
56
57
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 55

def associations
  @associations ||= AssociationsController.new @global_configuration
end

#cancelCancelController

Access to cancel controller.

Returns:



97
98
99
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 97

def cancel
  @cancel ||= CancelController.new @global_configuration
end

#countCountController

Access to count controller.

Returns:



73
74
75
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 73

def count
  @count ||= CountController.new @global_configuration
end

#cppreferenceCppreferenceController

Access to cppreference controller.

Returns:



175
176
177
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 175

def cppreference
  @cppreference ||= CppreferenceController.new @global_configuration
end

#feedsFeedsController

Access to feeds controller.

Returns:



37
38
39
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 37

def feeds
  @feeds ||= FeedsController.new @global_configuration
end

#get_pricing_insightsGetPricingInsightsController

Access to get_pricing_insights controller.

Returns:



157
158
159
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 157

def get_pricing_insights
  @get_pricing_insights ||= GetPricingInsightsController.new @global_configuration
end

#idIdController

Access to id controller.

Returns:



61
62
63
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 61

def id
  @id ||= IdController.new @global_configuration
end

#incentivesIncentivesController

Access to incentives controller.

Returns:



151
152
153
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 151

def incentives
  @incentives ||= IncentivesController.new @global_configuration
end

#inventoriesInventoriesController

Access to inventories controller.

Returns:



31
32
33
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 31

def inventories
  @inventories ||= InventoriesController.new @global_configuration
end

#inventoryInventoryController

Access to inventory controller.

Returns:



19
20
21
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 19

def inventory
  @inventory ||= InventoryController.new @global_configuration
end

#itemsItemsController

Access to items controller.

Returns:



79
80
81
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 79

def items
  @items ||= ItemsController.new @global_configuration
end

#ordersOrdersController

Access to orders controller.

Returns:



121
122
123
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 121

def orders
  @orders ||= OrdersController.new @global_configuration
end

#pricePriceController

Access to price controller.

Returns:



163
164
165
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 163

def price
  @price ||= PriceController.new @global_configuration
end

#purchase_order_idPurchaseOrderIdController

Access to purchase_order_id controller.

Returns:



109
110
111
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 109

def purchase_order_id
  @purchase_order_id ||= PurchaseOrderIdController.new @global_configuration
end

#refundRefundController

Access to refund controller.

Returns:



91
92
93
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 91

def refund
  @refund ||= RefundController.new @global_configuration
end

#releasedReleasedController

Access to released controller.

Returns:



115
116
117
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 115

def released
  @released ||= ReleasedController.new @global_configuration
end

#repricer_feedsRepricerFeedsController

Access to repricer_feeds controller.

Returns:



169
170
171
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 169

def repricer_feeds
  @repricer_feeds ||= RepricerFeedsController.new @global_configuration
end

#searchSearchController

Access to search controller.

Returns:



49
50
51
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 49

def search
  @search ||= SearchController.new @global_configuration
end

#shippingShippingController

Access to shipping controller.

Returns:



85
86
87
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 85

def shipping
  @shipping ||= ShippingController.new @global_configuration
end

#skuSkuController

Access to sku controller.

Returns:



25
26
27
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 25

def sku
  @sku ||= SkuController.new @global_configuration
end

#specSpecController

Access to spec controller.

Returns:



43
44
45
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 43

def spec
  @spec ||= SpecController.new @global_configuration
end

#strategiesStrategiesController

Access to strategies controller.

Returns:



139
140
141
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 139

def strategies
  @strategies ||= StrategiesController.new @global_configuration
end

#strategyStrategyController

Access to strategy controller.

Returns:



133
134
135
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 133

def strategy
  @strategy ||= StrategyController.new @global_configuration
end

#strategy_collection_idStrategyCollectionIdController

Access to strategy_collection_id controller.

Returns:



127
128
129
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 127

def strategy_collection_id
  @strategy_collection_id ||= StrategyCollectionIdController.new @global_configuration
end

#taxonomyTaxonomyController

Access to taxonomy controller.

Returns:



67
68
69
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 67

def taxonomy
  @taxonomy ||= TaxonomyController.new @global_configuration
end

#user_agent_detailObject



13
14
15
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 13

def user_agent_detail
  config.user_agent_detail
end

#wfpreferenceWfpreferenceController

Access to wfpreference controller.

Returns:



145
146
147
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/client.rb', line 145

def wfpreference
  @wfpreference ||= WfpreferenceController.new @global_configuration
end