Class: WalmartApIs::Client
- Inherits:
-
Object
- Object
- WalmartApIs::Client
- Includes:
- CoreLibrary
- Defined in:
- lib/walmart_ap_is/client.rb
Overview
walmart_ap_is client class.
Instance Attribute Summary collapse
-
#auth_managers ⇒ Object
readonly
Returns the value of attribute auth_managers.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
-
.from_env(**overrides) ⇒ Object
Creates a client directly from environment variables.
Instance Method Summary collapse
-
#authorization ⇒ AuthorizationApi
Access to authorization controller.
-
#catalog ⇒ CatalogApi
Access to catalog controller.
-
#data_kiosk ⇒ DataKioskApi
Access to data_kiosk controller.
-
#disputes ⇒ DisputesApi
Access to disputes controller.
-
#fba_inventory ⇒ FbaInventoryApi
Access to fba_inventory controller.
-
#feeds ⇒ FeedsApi
Access to feeds controller.
-
#fees ⇒ FeesApi
Access to fees controller.
-
#final_payout ⇒ FinalPayoutApi
Access to final_payout controller.
-
#finances ⇒ FinancesApi
Access to finances controller.
-
#fulfillment_outbound ⇒ FulfillmentOutboundApi
Access to fulfillment_outbound controller.
-
#initialize(connection: nil, adapter: :net_http_persistent, timeout: 30, 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, logging_configuration: nil, environment: Environment::PRODUCTION, seller_auth_authorization_code_credentials: nil, seller_auth_client_credentials_credentials: nil, basic_client_auth_credentials: nil, wallet_auth_credentials: nil, config: nil) ⇒ Client
constructor
A new instance of Client.
-
#initialize_auth_managers(global_config) ⇒ Object
Initializes the auth managers hash used for authenticating API calls.
-
#inventory ⇒ InventoryApi
Access to inventory controller.
-
#listings_items ⇒ ListingsItemsApi
Access to listings_items controller.
-
#listings_restrictions ⇒ ListingsRestrictionsApi
Access to listings_restrictions controller.
-
#merchant_fulfillment ⇒ MerchantFulfillmentApi
Access to merchant_fulfillment controller.
-
#messaging ⇒ MessagingApi
Access to messaging controller.
-
#notifications ⇒ NotificationsApi
Access to notifications controller.
-
#oauth_authorization ⇒ OauthAuthorizationApi
Access to oauth_authorization controller.
-
#orders ⇒ OrdersApi
Access to orders controller.
-
#payouts ⇒ PayoutsApi
Access to payouts controller.
-
#product_fees ⇒ ProductFeesApi
Access to product_fees controller.
-
#product_pricing ⇒ ProductPricingApi
Access to product_pricing controller.
-
#product_type_definitions ⇒ ProductTypeDefinitionsApi
Access to product_type_definitions controller.
-
#reconciliation ⇒ ReconciliationApi
Access to reconciliation controller.
-
#report_schedules ⇒ ReportSchedulesApi
Access to report_schedules controller.
-
#reports ⇒ ReportsApi
Access to reports controller.
-
#sales ⇒ SalesApi
Access to sales controller.
-
#seller_auth_authorization_code ⇒ Object
Returns the configured authentication sellerAuth_authorization_code instance.
-
#seller_auth_client_credentials ⇒ Object
Returns the configured authentication sellerAuth_client_credentials instance.
-
#sellers ⇒ SellersApi
Access to sellers controller.
-
#settlement ⇒ SettlementApi
Access to settlement controller.
-
#shipping ⇒ ShippingApi
Access to shipping controller.
-
#solicitations ⇒ SolicitationsApi
Access to solicitations controller.
-
#uploads ⇒ UploadsApi
Access to uploads controller.
- #user_agent_detail ⇒ Object
-
#wallet_auth ⇒ Object
Returns the configured authentication walletAuth instance.
-
#wfs_inbound ⇒ WfsInboundApi
Access to wfs_inbound controller.
-
#wfs_inventory ⇒ WfsInventoryApi
Access to wfs_inventory controller.
Constructor Details
#initialize(connection: nil, adapter: :net_http_persistent, timeout: 30, 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, logging_configuration: nil, environment: Environment::PRODUCTION, seller_auth_authorization_code_credentials: nil, seller_auth_client_credentials_credentials: nil, basic_client_auth_credentials: nil, wallet_auth_credentials: nil, config: nil) ⇒ Client
Returns a new instance of Client.
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/walmart_ap_is/client.rb', line 229 def initialize( connection: nil, adapter: :net_http_persistent, timeout: 30, 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, logging_configuration: nil, environment: Environment::PRODUCTION, seller_auth_authorization_code_credentials: nil, seller_auth_client_credentials_credentials: nil, basic_client_auth_credentials: nil, wallet_auth_credentials: nil, 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, logging_configuration: logging_configuration, environment: environment, seller_auth_authorization_code_credentials: , seller_auth_client_credentials_credentials: seller_auth_client_credentials_credentials, basic_client_auth_credentials: basic_client_auth_credentials, wallet_auth_credentials: wallet_auth_credentials ) else config end user_agent_params = BaseApi.user_agent_parameters @global_configuration = GlobalConfiguration.new(client_configuration: @config) .base_uri_executor(@config.method(:get_base_uri)) .global_errors(BaseApi::GLOBAL_ERRORS) .user_agent(BaseApi.user_agent, agent_parameters: user_agent_params) initialize_auth_managers(@global_configuration) @global_configuration = @global_configuration.auth_managers(@auth_managers) end |
Instance Attribute Details
#auth_managers ⇒ Object (readonly)
Returns the value of attribute auth_managers.
10 11 12 |
# File 'lib/walmart_ap_is/client.rb', line 10 def auth_managers @auth_managers end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/walmart_ap_is/client.rb', line 10 def config @config end |
Class Method Details
.from_env(**overrides) ⇒ Object
Creates a client directly from environment variables.
292 293 294 295 296 |
# File 'lib/walmart_ap_is/client.rb', line 292 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
#authorization ⇒ AuthorizationApi
Access to authorization controller.
33 34 35 |
# File 'lib/walmart_ap_is/client.rb', line 33 def @authorization ||= AuthorizationApi.new @global_configuration end |
#catalog ⇒ CatalogApi
Access to catalog controller.
39 40 41 |
# File 'lib/walmart_ap_is/client.rb', line 39 def catalog @catalog ||= CatalogApi.new @global_configuration end |
#data_kiosk ⇒ DataKioskApi
Access to data_kiosk controller.
45 46 47 |
# File 'lib/walmart_ap_is/client.rb', line 45 def data_kiosk @data_kiosk ||= DataKioskApi.new @global_configuration end |
#disputes ⇒ DisputesApi
Access to disputes controller.
135 136 137 |
# File 'lib/walmart_ap_is/client.rb', line 135 def disputes @disputes ||= DisputesApi.new @global_configuration end |
#fba_inventory ⇒ FbaInventoryApi
Access to fba_inventory controller.
81 82 83 |
# File 'lib/walmart_ap_is/client.rb', line 81 def fba_inventory @fba_inventory ||= FbaInventoryApi.new @global_configuration end |
#feeds ⇒ FeedsApi
Access to feeds controller.
51 52 53 |
# File 'lib/walmart_ap_is/client.rb', line 51 def feeds @feeds ||= FeedsApi.new @global_configuration end |
#fees ⇒ FeesApi
Access to fees controller.
165 166 167 |
# File 'lib/walmart_ap_is/client.rb', line 165 def fees @fees ||= FeesApi.new @global_configuration end |
#final_payout ⇒ FinalPayoutApi
Access to final_payout controller.
141 142 143 |
# File 'lib/walmart_ap_is/client.rb', line 141 def final_payout @final_payout ||= FinalPayoutApi.new @global_configuration end |
#finances ⇒ FinancesApi
Access to finances controller.
147 148 149 |
# File 'lib/walmart_ap_is/client.rb', line 147 def finances @finances ||= FinancesApi.new @global_configuration end |
#fulfillment_outbound ⇒ FulfillmentOutboundApi
Access to fulfillment_outbound controller.
63 64 65 |
# File 'lib/walmart_ap_is/client.rb', line 63 def fulfillment_outbound @fulfillment_outbound ||= FulfillmentOutboundApi.new @global_configuration end |
#initialize_auth_managers(global_config) ⇒ Object
Initializes the auth managers hash used for authenticating API calls.
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/walmart_ap_is/client.rb', line 272 def initialize_auth_managers(global_config) @auth_managers = {} http_client_config = global_config.client_configuration %w[sellerAuth_authorization_code sellerAuth_client_credentials basicClientAuth walletAuth].each do |auth| @auth_managers[auth] = nil end @auth_managers['sellerAuth_authorization_code'] = SellerAuthAuthorizationCode.new( http_client_config., global_config ) @auth_managers['sellerAuth_client_credentials'] = SellerAuthClientCredentials.new( http_client_config.seller_auth_client_credentials_credentials, global_config ) @auth_managers['basicClientAuth'] = BasicClientAuth.new( http_client_config.basic_client_auth_credentials ) @auth_managers['walletAuth'] = WalletAuth.new(http_client_config.wallet_auth_credentials, global_config) end |
#inventory ⇒ InventoryApi
Access to inventory controller.
69 70 71 |
# File 'lib/walmart_ap_is/client.rb', line 69 def inventory @inventory ||= InventoryApi.new @global_configuration end |
#listings_items ⇒ ListingsItemsApi
Access to listings_items controller.
87 88 89 |
# File 'lib/walmart_ap_is/client.rb', line 87 def listings_items @listings_items ||= ListingsItemsApi.new @global_configuration end |
#listings_restrictions ⇒ ListingsRestrictionsApi
Access to listings_restrictions controller.
93 94 95 |
# File 'lib/walmart_ap_is/client.rb', line 93 def listings_restrictions @listings_restrictions ||= ListingsRestrictionsApi.new @global_configuration end |
#merchant_fulfillment ⇒ MerchantFulfillmentApi
Access to merchant_fulfillment controller.
99 100 101 |
# File 'lib/walmart_ap_is/client.rb', line 99 def merchant_fulfillment @merchant_fulfillment ||= MerchantFulfillmentApi.new @global_configuration end |
#messaging ⇒ MessagingApi
Access to messaging controller.
195 196 197 |
# File 'lib/walmart_ap_is/client.rb', line 195 def messaging @messaging ||= MessagingApi.new @global_configuration end |
#notifications ⇒ NotificationsApi
Access to notifications controller.
201 202 203 |
# File 'lib/walmart_ap_is/client.rb', line 201 def notifications @notifications ||= NotificationsApi.new @global_configuration end |
#oauth_authorization ⇒ OauthAuthorizationApi
Access to oauth_authorization controller.
225 226 227 |
# File 'lib/walmart_ap_is/client.rb', line 225 def @oauth_authorization ||= OauthAuthorizationApi.new @global_configuration end |
#orders ⇒ OrdersApi
Access to orders controller.
105 106 107 |
# File 'lib/walmart_ap_is/client.rb', line 105 def orders @orders ||= OrdersApi.new @global_configuration end |
#payouts ⇒ PayoutsApi
Access to payouts controller.
129 130 131 |
# File 'lib/walmart_ap_is/client.rb', line 129 def payouts @payouts ||= PayoutsApi.new @global_configuration end |
#product_fees ⇒ ProductFeesApi
Access to product_fees controller.
159 160 161 |
# File 'lib/walmart_ap_is/client.rb', line 159 def product_fees @product_fees ||= ProductFeesApi.new @global_configuration end |
#product_pricing ⇒ ProductPricingApi
Access to product_pricing controller.
153 154 155 |
# File 'lib/walmart_ap_is/client.rb', line 153 def product_pricing @product_pricing ||= ProductPricingApi.new @global_configuration end |
#product_type_definitions ⇒ ProductTypeDefinitionsApi
Access to product_type_definitions controller.
171 172 173 |
# File 'lib/walmart_ap_is/client.rb', line 171 def product_type_definitions @product_type_definitions ||= ProductTypeDefinitionsApi.new @global_configuration end |
#reconciliation ⇒ ReconciliationApi
Access to reconciliation controller.
117 118 119 |
# File 'lib/walmart_ap_is/client.rb', line 117 def reconciliation @reconciliation ||= ReconciliationApi.new @global_configuration end |
#report_schedules ⇒ ReportSchedulesApi
Access to report_schedules controller.
177 178 179 |
# File 'lib/walmart_ap_is/client.rb', line 177 def report_schedules @report_schedules ||= ReportSchedulesApi.new @global_configuration end |
#reports ⇒ ReportsApi
Access to reports controller.
123 124 125 |
# File 'lib/walmart_ap_is/client.rb', line 123 def reports @reports ||= ReportsApi.new @global_configuration end |
#sales ⇒ SalesApi
Access to sales controller.
183 184 185 |
# File 'lib/walmart_ap_is/client.rb', line 183 def sales @sales ||= SalesApi.new @global_configuration end |
#seller_auth_authorization_code ⇒ Object
Returns the configured authentication sellerAuth_authorization_code instance.
17 18 19 |
# File 'lib/walmart_ap_is/client.rb', line 17 def @auth_managers['sellerAuth_authorization_code'] end |
#seller_auth_client_credentials ⇒ Object
Returns the configured authentication sellerAuth_client_credentials instance.
22 23 24 |
# File 'lib/walmart_ap_is/client.rb', line 22 def seller_auth_client_credentials @auth_managers['sellerAuth_client_credentials'] end |
#sellers ⇒ SellersApi
Access to sellers controller.
207 208 209 |
# File 'lib/walmart_ap_is/client.rb', line 207 def sellers @sellers ||= SellersApi.new @global_configuration end |
#settlement ⇒ SettlementApi
Access to settlement controller.
111 112 113 |
# File 'lib/walmart_ap_is/client.rb', line 111 def settlement @settlement ||= SettlementApi.new @global_configuration end |
#shipping ⇒ ShippingApi
Access to shipping controller.
213 214 215 |
# File 'lib/walmart_ap_is/client.rb', line 213 def shipping @shipping ||= ShippingApi.new @global_configuration end |
#solicitations ⇒ SolicitationsApi
Access to solicitations controller.
189 190 191 |
# File 'lib/walmart_ap_is/client.rb', line 189 def solicitations @solicitations ||= SolicitationsApi.new @global_configuration end |
#uploads ⇒ UploadsApi
Access to uploads controller.
219 220 221 |
# File 'lib/walmart_ap_is/client.rb', line 219 def uploads @uploads ||= UploadsApi.new @global_configuration end |
#user_agent_detail ⇒ Object
12 13 14 |
# File 'lib/walmart_ap_is/client.rb', line 12 def user_agent_detail config.user_agent_detail end |
#wallet_auth ⇒ Object
Returns the configured authentication walletAuth instance.
27 28 29 |
# File 'lib/walmart_ap_is/client.rb', line 27 def wallet_auth @auth_managers['walletAuth'] end |
#wfs_inbound ⇒ WfsInboundApi
Access to wfs_inbound controller.
57 58 59 |
# File 'lib/walmart_ap_is/client.rb', line 57 def wfs_inbound @wfs_inbound ||= WfsInboundApi.new @global_configuration end |
#wfs_inventory ⇒ WfsInventoryApi
Access to wfs_inventory controller.
75 76 77 |
# File 'lib/walmart_ap_is/client.rb', line 75 def wfs_inventory @wfs_inventory ||= WfsInventoryApi.new @global_configuration end |