Module: AmznSpApi

Defined in:
lib/amzn_sp_api/sp_api_configuration.rb,
lib/amzn_sp_api.rb,
lib/amzn_sp_api/api_error.rb,
lib/amzn_sp_api/api_client.rb,
lib/amzn_sp_api/configuration.rb,
lib/amzn_sp_api/sp_api_client.rb,
lib/amzn_sp_api/amzn_sp_api_version.rb

Overview

Defined Under Namespace

Modules: AplusContentApiModel, AuthorizationApiModel, CatalogItemsApiModel, EasyShipApiModel, FbaInboundEligibilityApiModel, FbaInventoryApiModel, FbaSmallAndLightApiModel, FeedsApiModel, FinancesApiModel, FulfillmentInboundApiModel, FulfillmentOutboundApiModel, ListingsItemsApiModel, ListingsRestrictionsApiModel, MerchantFulfillmentApiModel, MessagingApiModel, NotificationsApiModel, OrdersApiModel, ProductFeesApiModel, ProductPricingApiModel, ProductTypeDefinitionsApiModel, ReportsApiModel, SalesApiModel, SellersApiModel, ServicesApiModel, ShipmentInvoicingApiModel, ShippingApiModel, SolicitationsApiModel, TokensApiModel, UploadsApiModel Classes: ApiClient, ApiError, Configuration, SpApiClient, SpApiConfiguration

Constant Summary collapse

VERSION =
'1.0.6'

Class Method Summary collapse

Class Method Details

.configureObject

Customize default settings for the SDK using block.

AmznSpApi.configure do |config|
end

If no block given, return the default Configuration object.



12
13
14
15
16
17
18
# File 'lib/amzn_sp_api.rb', line 12

def configure
  if block_given?
    yield(SpApiConfiguration.default)
  else
    SpApiConfiguration.default
  end
end

.inflate_document(body, document_response) ⇒ Object

Raises:

  • (AmzSpApi::ApiError)


20
21
22
23
24
25
26
# File 'lib/amzn_sp_api.rb', line 20

def inflate_document(body, document_response)
  compression = document_response.compression_algorithm
  return body unless compression
  raise AmzSpApi::ApiError, "unknown compressionAlgorithm #{compression}" if compression != 'GZIP'

  Zlib.gunzip(body)
end